package controller.transform;

import javax.vecmath.Vector3d;

import math.Precision;

import component.Ball;

public class AlignToXY extends AlignToPlane {

	public AlignToXY(Gui gui, Scene scene, Ball pivot) {
		super(gui, scene, pivot);
	}

	@Override
	protected Vector3d getAlignToVector(Vector3d tubeVector) {
		Vector3d align = new Vector3d(tubeVector);
		align.z = 0;
		if (align.length() < Precision.ERROR_MARGIN) {
			align.set(tubeVector);
			gui.setStatusText("Unable to align with XY plane.");
		}
		return align;
	}

	@Override
	protected void setDefaultText() {
		gui.setStatusText("Select tube to align with XY plane.");
	}

}
